Skip to content

Conversation

leodido
Copy link

@leodido leodido commented Sep 29, 2025

Description

Adds the leeway plumbing sign-cache command for signing cache artifacts with SLSA v0.2 attestations, completing the SLSA Level 3 implementation started in PR #242 and PR #243.

Changes

  • New sign-cache command: CLI for signing cache artifacts from manifest files
  • Sigstore keyless signing: Full integration with GitHub OIDC and Sigstore infrastructure
  • Attestation generation: Creates SLSA v0.2 attestations in DSSE format
  • Manifest processing: Reads artifact paths from CI-generated manifest files
  • Upload integration: Uploads signed artifacts and .att files to S3 cache

Builds on existing cache verification (PR #242) and in-flight checksumming (PR #243) to provide complete signing infrastructure for separated CI jobs.

Related Issue(s)

Completes SLSA Level 3 cache artifact signing implementation.

Fixes https://linear.app/ona-team/issue/CLC-1959/create-leeway-signing-command

How to test

Basic functionality:

# Test signing command
echo "/tmp/test.tar.gz" > manifest.txt && touch /tmp/test.tar.gz
go build ./cmd/sign-cache && ./sign-cache --from-manifest manifest.txt --dry-run
permissions:
  id-token: write  # Required for Sigstore
steps:
  - run: leeway plumbing sign-cache --from-manifest artifacts-to-sign.txt

leodido and others added 5 commits September 26, 2025 21:08
- Add comprehensive SLSA v0.2 provenance generation using in-toto libraries
- Implement keyless signing with Sigstore integration
- Create structured error handling for signing operations
- Add GitHub Actions context validation and extraction
- Support .att file format compatible with existing verification
- Replace parallel signing approach with single-step generation and signing

Co-authored-by: Ona <[email protected]>
- Implement leeway plumbing sign-cache command for secure artifact signing
- Add --from-manifest flag to process build manifests from previous jobs
- Support parallel artifact processing with WaitGroup coordination
- Create adapter pattern for RemoteCache interface compatibility
- Enable separation of build and signing concerns in CI workflows
- Support GitHub Actions OIDC token-based keyless signing

Co-authored-by: Ona <[email protected]>
- Add github.com/sigstore/sigstore-go v1.1.2 for keyless signing
- Update in-toto libraries for SLSA v0.2 provenance generation
- Upgrade AWS SDK and other dependencies to latest versions
- Support GitHub Actions OIDC token integration

Co-authored-by: Ona <[email protected]>
- Replace TODO placeholder with actual sigstore-go v1.1.2 API calls
- Add proper DSSE format for SLSA attestations (application/vnd.in-toto+json)
- Implement TUF-based trusted root and signing config fetching
- Add dynamic Fulcio and Rekor service selection from signing config
- Remove manual OIDC token handling, let sigstore-go handle GitHub OIDC automatically
- Add comprehensive GitHub Actions environment validation (GITHUB_ACTIONS=true)
- Replace placeholder attestation envelope with real Sigstore bundles
- Improve error messages for better debugging in CI environments

Fixes critical API usage issues identified in code review.
Enables production keyless signing with GitHub OIDC tokens.

Co-authored-by: Ona <[email protected]>
- Use getRemoteCacheFromEnv() instead of getRemoteCache(cmd) for cleaner interface
- Remove unused imports (path/filepath, time) to clean up dependencies
- Improve command interface consistency with other leeway commands

Co-authored-by: Ona <[email protected]>
@leodido leodido self-assigned this Sep 29, 2025
@leodido leodido requested review from geropl and csweichel September 29, 2025 19:49
@leodido leodido marked this pull request as ready for review September 29, 2025 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant